package cpu;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class CPUTaskTest {
    private static ExecutorService service = Executors.newFixedThreadPool(5);

    public static Object lock = new Object();

    public static class CPUTask implements Runnable {

        @Override
        public void run() {
            synchronized (lock) {
                long sum = 0L;
                while (true) {
                    sum ++;
                }
            }
        }
    }


    public static void main(String[] args) {
        CPUTask cpuTask = new CPUTask();
        service.execute(cpuTask);
    }
}
